﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VisualPoint.Controls.Actions;
using VisualPoint.Controls.Environments;

namespace VisualPoint.Test
{
    public class MockEnvironment : IEnvironment
    {
        private ITextLog Log;

        public MockEnvironment(ITextLog log)
        {
           this.Log = log;
        }
        public void OpenDocument(string projectName, string folder, string fileName, string viewKind, bool selectInExplorer)
        {
            Log.SetText(string.Format("Project: {0} Folder: {1} File: {2}", projectName, folder, fileName));
        }


        public void SelectText(string text)
        {
            Log.SetText(string.Format("SelectText: {0}", text));
        }


        public void CloseDocument(string projectName, string folder, string fileName, FileCloseOption closeOption)
        {
            Log.SetText(string.Format("Project: {0} Folder: {1} File: {2} ActiveDocument: {3}", projectName, folder, fileName, closeOption));
            
        }


        public void WriteText(string text)
        {
            Log.SetText(string.Format("WriteText: {0}", text));
        }


        public void ResizeNormal()
        {
            Log.SetText("ResizeNormal");
        }

        public void ResizeFullScreen()
        {
            Log.SetText("ResizeFullScreen");
        }


        public string GetSelectedText()
        {
            return "GetSelectedText";
        }


        public void SelectWindow(WindowSelectOption selectOption, string windowName, string windowConstant)
        {
            Log.SetText(string.Format("Name: {0} Constant: {1} Option: {2}", windowName, windowConstant, selectOption));
        }


        public void ResizeDock(string dockWith, EnvDTE.vsLinkedWindowType dockAt)
        {
            throw new NotImplementedException();
        }

        public System.Collections.ObjectModel.Collection<string> GetWindowConfigurations()
        {
            Collection<string> l = new Collection<string>();
            l.Add("config 1");
            l.Add("config 2");
            l.Add("config 3");
            return l;
        }


        public void Resize(ResizeOption ResizeOption, string DockWith, EnvDTE.vsLinkedWindowType DockAt, string Configuration)
        {
            
        }

        public void UpdateWindowConfiguration(string value)
        {
            
        }

        public void DeleteWindowConfiguration(string value)
        {
            
        }

        public void CreateWindowConfiguration(string value)
        {
            
        }

        public string GetActiveWindowConfiguration()
        {
            return "config 2";
        }
    }
}
